#include "widget.h"
#include "ui_widget.h"
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    //编辑下拉框选项内容
    ui->comboBox->addItem("米饭");
    ui->comboBox->addItem("面条");
    ui->comboBox_2->addItem("豆角");
    ui->comboBox_2->addItem("排骨");

    //修改SpinBox的范围属性
    ui->spinBox->setRange(1, 5);
    ui->spinBox_2->setRange(1, 2);
    //设置默认值
    ui->spinBox->setValue(1);
    ui->spinBox_2->setValue(1);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    qDebug() << "选中的内容是: "
             << ui->comboBox->currentText() << ":" << ui->spinBox->value()
             << ui->comboBox_2->currentText() << ":" << ui->spinBox_2->value();

}
